package com.aos.erp.common.config;

import com.aos.erp.common.lock.AxLockMethodInterceptor;
import com.aos.erp.common.redis.impl.RedisLockServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Slf4j
@Configuration
public class LockConfiguration {

    @Bean
    public AxLockMethodInterceptor axLockMethodInterceptor() {
        return new AxLockMethodInterceptor();
    }

    /**
     * 基于redis实现的分布式锁
     *
     * @return
     */
    @Bean
    public RedisLockServiceImpl lockService() {
        return new RedisLockServiceImpl();
    }
}